/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aaron.platform.dao;

import com.aaron.platform.entity.ItscRoleInfo;
import com.aaron.platform.entity.ItscUserInfo;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

/**
 * user dao implementation
 * @author mac
 */
public class UserDaoImp extends GenericDAO<ItscUserInfo, Integer> implements IUserDao{

    public UserDaoImp(){
        super(ItscUserInfo.class);
    }

    public ItscUserInfo findUserByName(String userName){
            return findByUniqueKey(ItscUserInfo.PROPERTY_USER_NAME, userName);
    }

    public List<ItscUserInfo> findUsersByRoleId(Integer roleId) {
        return findByProperty(ItscUserInfo.PROPERTY_USER_ROLEID, roleId);
    }
}
